package cn.gqr.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

@TableName("t_order_details")
public class OrderDetail {

    @TableId(type = IdType.AUTO)
    private Integer  id; //订单明细编号

    private  Integer orderId;//订单编号

    private Integer bookId;//书本编号

    private int num;//购买数量

    private double price;//购买价格

    @TableField(exist = false)
    private Integer cartId;


    public Integer getCartId() {
        return cartId;
    }

    public void setCartId(Integer cartId) {
        this.cartId = cartId;
    }

    public OrderDetail() {
    }

    public OrderDetail(Integer orderId, Integer bookId, int num, double price,Integer cartId) {
        this.orderId = orderId;
        this.bookId = bookId;
        this.num = num;
        this.price = price;
        this.cartId =cartId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    public Integer getBookId() {
        return bookId;
    }

    public void setBookId(Integer bookId) {
        this.bookId = bookId;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "OrderDetail{" +
                "id=" + id +
                ", orderId=" + orderId +
                ", bookId=" + bookId +
                ", num=" + num +
                ", price=" + price +
                '}';
    }
}
